<table> 
    
      <?php foreach ($pager->getResults() as $i=>$ogloszenie): ?>

     <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
       <?php include_component('ogloszenia','frontpage', array('ogloszenie' => $ogloszenie)) ?>
    </tr>
    <tr><td></td></tr>

    <?php endforeach; ?>
</table>



  <a href="<?php echo url_for('ogloszenia/new') ?>">New</a>
<?php if ($pager->haveToPaginate()): ?>
  <?php echo link_to('&laquo;', 'ogloszenia/index?page='.$pager->getFirstPage()) ?>
  <?php echo link_to('&lt;', 'ogloszenia/index?page='.$pager->getPreviousPage()) ?>
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <?php echo ($page == $pager->getPage()) ? $page : link_to($page, 'ogloszenia/index?page='.$page) ?>
    <?php if ($page != $pager->getCurrentMaxLink()): ?> - <?php endif ?>
  <?php endforeach ?>
  <?php echo link_to('&gt;', 'ogloszenia/index?page='.$pager->getNextPage()) ?>
  <?php echo link_to('&raquo;', 'ogloszenia/index?page='.$pager->getLastPage()) ?>
<?php endif ?>